﻿@model PhoneBilling.Models.ExtensionEditModel
@{
    ViewBag.Title = "分机编辑";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<script type="text/javascript">    
$(document).ready(           
function () 
{  
    $(".myDatePickerClass ").datepicker({
        buttonImage: '@Url.Content("~/Content/image/calendar.gif")',               
        dateFormat: 'yy/mm/dd',                 
        showOn: 'button',               
        buttonImageOnly: true ,
        changeMonth:true,              
        changeYear:true,
    });   
}       
);
function changeAreaType() 
{
     var str = "";
     $(".areaType").each(function()
     {
        if($(this).attr("checked") == "checked")
        {
            str += $(this).attr("id");
        }
     });
     $("#areaType").val(str);
}
</script>
@using (Html.BeginForm())
{
    <div>
        <h3 class="tlt">分机信息</h3>
        @Html.HiddenFor(m => m.GroupID)
        @Html.HiddenFor(m => m.SourceGroupID)
        @Html.HiddenFor(m => m.IsNew)
        @Html.HiddenFor(m => m.IsToSearch)
        <div class="input-text">
             @Html.LabelFor(m => m.分机号码)
    @{
        if (Model.IsNew)
        {
             @Html.TextBoxFor(m => m.分机号码)
             @Html.ValidationMessageFor(m => m.分机号码, new { style = "color:Red" })
        }
        else
        {
              @Html.DisplayFor(m => m.分机号码)
              @Html.HiddenFor(m => m.分机号码)
        }
    }
        </div>
        <div class="input-text">
             @Html.LabelFor(m => m.费率)
             @Html.DropDownListFor(m => m.费率, new SelectList(Model.TraiffList, "ID", "Name"), new { style = "input-text" })
             @Html.ValidationMessageFor(m => m.费率, new { style = "color:Red" })
        </div>
        <div class="input-text">
             @Html.LabelFor(m => m.收费等级)
             @Html.DropDownListFor(m => m.收费等级, new SelectList(Model.GradeList, "ID", "Name"), new { style = "input-text" })
             @Html.ValidationMessageFor(m => m.收费等级, new { style = "color:Red" })
        </div>
        <div class="input-text">
             @Html.LabelFor(m => m.报警限额)
             @Html.TextBoxFor(m => m.报警限额)
             @Html.ValidationMessageFor(m => m.报警限额, new { style = "color:Red" })
             @Html.LabelFor(m => m.月杂费)
             @Html.TextBoxFor(m => m.月杂费)
             @Html.ValidationMessageFor(m => m.月杂费, new { style = "color:Red" })
        </div>
        <div class="input-text">
            @Html.LabelFor(m => m.收费话类)
            @Html.HiddenFor(m => m.收费话类, new { id = "areaType" })
            @{
       for (int i = 0; i < Model.话类List.Count; i++)
       {
                @Html.CheckBoxFor(m => m.话类List[i].IsSelected, new { onclick = "changeAreaType()", @class = "areaType", id = Model.话类List[i].ID })
                @Html.Label(string.Format(" {0} ", Model.话类List[i].Name))
       }
            }
        @Html.ValidationMessageFor(m => m.收费话类, new { style = "color:Red" })
        </div>
        <h3 class="tlt">用户信息</h3>
        <div class="input-text">
             @Html.LabelFor(m => m.用户名)
             @Html.TextBoxFor(m => m.用户名)
             @Html.ValidationMessageFor(m => m.用户名, new { style = "color:Red" })
             @Html.LabelFor(m => m.地址)
             @Html.TextBoxFor(m => m.地址)
             @Html.ValidationMessageFor(m => m.地址, new { style = "color:Red" })
        </div>
        <div class="input-text">
             @Html.LabelFor(m => m.分机功能)
             @Html.TextBoxFor(m => m.分机功能)
             @Html.ValidationMessageFor(m => m.分机功能, new { style = "color:Red" })
             @Html.LabelFor(m => m.机架线号)
             @Html.TextBoxFor(m => m.机架线号)
             @Html.ValidationMessageFor(m => m.机架线号, new { style = "color:Red" })
        </div>
        <div class="input-text">
             @Html.LabelFor(m => m.安装日期)
             @Html.TextBox("安装日期", Model.安装日期.ToString("d"), new { @class = "myDatePickerClass" }) 
             @Html.ValidationMessageFor(m => m.安装日期, new { style = "color:Red" })
             @Html.LabelFor(m => m.备注)
             @Html.TextBoxFor(m => m.备注)
             @Html.ValidationMessageFor(m => m.备注, new { style = "color:Red" })
        </div>
        <p class="submit">
            <input type="submit" value="确定" class="input-submit" />
        </p>
    </div>
}



